# Contributor: Jelle van der Waa <jelle vdwaa nl>

pkgname=hyphen-nl
pkgver=20050617
pkgrel=6
pkgdesc="Dutch hyphenation rules"
arch=('any')
url="https://wiki.services.openoffice.org/wiki/Dictionaries#Dutch_.28Netherlands.29"
license=('GPL2')
optdepends=('hyphen: offers hyphenation library functions')
source=("https://www.mirrorservice.org/sites/download.openoffice.org/contrib/dictionaries/hyph_nl_NL.zip")
sha256sums=('f48cb8a7ec86b94fe7383fd0c781c83b69c57b595cb10a6a69a5444f4f2368a7')

package() {
  install -dm755 "${pkgdir}/usr/share/hyphen"
  install -m644 hyph_nl_NL.dic "${pkgdir}/usr/share/hyphen/hyph_nl_NL.dic"

  pushd "${pkgdir}/usr/share/hyphen/"
  nl_NL_aliases="nl_AW nl_BE"
  for lang in ${nl_NL_aliases}; do
        ln -s hyph_nl_NL.dic hyph_${lang}.dic
  done

  popd

  # the symlinks
  install -dm755 "${pkgdir}/usr/share/myspell/dicts"
  pushd "${pkgdir}/usr/share/myspell/dicts"
    for file in "${pkgdir}"/usr/share/hyphen/*; do
      ln -sv /usr/share/hyphen/$(basename ${file}) .
    done
  popd

  # docs
  install -dm755 "${pkgdir}/usr/share/doc/${pkgname}"
  install -m644 README_hyph_nl_NL.txt "${pkgdir}/usr/share/doc/${pkgname}/README_hyph_nl_NL.txt"
}
